<?php
/**
 * file:inc.php
 * This file is part of J-Game.
 * @link https://www.liangboceo.com
 * @document https://doc.liangboceo.com
 * @contact 173120209@qq.com
 * @autho:jackliang
 */

function loadByNamespace($name)
{
    $class_path = str_replace('\\', DIRECTORY_SEPARATOR, $name);
    $class_file="";
    if (strpos($name, 'f4engine\\') === 0) {
        $class_file = __DIR__ .'/../'.substr($class_path, strlen('f4engine')) . '.php';
    }
    if (is_file($class_file)) {
        require_once($class_file);
        if (class_exists($name, false)) {
            return true;
        }
    }
    return false;
}

spl_autoload_register('loadByNamespace');